﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace TB_WS.ASMX
{
    /// <summary>
    /// TB_Top 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消注释以下行。 
    // [System.Web.Script.Services.ScriptService]
    public class TB_Top : System.Web.Services.WebService
    {

        [WebMethod(Description ="根据订单号组返回是否可返现")]
        public string JUDGE_RATE(string Tids,string Seller_Nick,string WX_User_Server)
        {
            Class.Top_Logic TL = new Class.Top_Logic(Seller_Nick);
            return TL.GET_Rate_State_New(Tids,WX_User_Server);
        }

        [WebMethod(Description ="根据订单检测是否为淘宝订单")]
        public string Check_TB_Tids(string Tids,string Seller_Nick)
        {
            Class.Top_Logic TL = new Class.Top_Logic(Seller_Nick);
            return TL.Check_TB_Tids(Tids);
        }

        [WebMethod(Description ="根据订单号获取买家Nick")]
        public string Get_Buyer_Nick_Tids(string Tids, string Seller_Nick)
        {
            Class.Top_Logic TL = new Class.Top_Logic(Seller_Nick);
            return TL.Get_Nick_TB_Tids(Tids);
        }

        [WebMethod(Description ="通过订单号新增或修改备注信息")]
        public string UPDATE_MEMO(string Tid,string Memo,string Seller_Nick)
        {
            Class.Top_Logic TL = new Class.Top_Logic(Seller_Nick);
            return TL.Set_Seller_Memo(Tid, Memo);
        }

        [WebMethod(Description ="测试追加评价获取接口")]
        public string Test_HB(string Seller_Nick,string Tids,string WX_User_Server)
        {
            Class.Top_Logic CTL = new Class.Top_Logic(Seller_Nick);
            return CTL.GET_Rate_State_Appened_Rate_2(Tids,WX_User_Server);
        }

        [WebMethod(Description = "测试接口")]
        public string Test_HB_New(string Tids, string WX_User_Server)
        {
            Class.Top_Logic CTL = new Class.Top_Logic("我就爱购数码专营店");
            return CTL.GET_Rate_State_New(Tids,WX_User_Server);
        }

        [WebMethod(Description ="评价获取")]
        public string Get_Rate_Feed(string Tids,string Seller_Nick)
        {
            Class.Top_Logic CTL = new Class.Top_Logic(Seller_Nick);
            return CTL.Get_Rate_Feed(Tids);
        }

        [WebMethod(Description = "测试模板消息")]
        public void Test_TM()
        {
            LeShiTao_Library.WeChat.Public_WC.Template_Message TM = new LeShiTao_Library.WeChat.Public_WC.Template_Message("59igou");
            TM.TM_Get_Rate_Message("59igou", "r32dew323877uh", "中差评提醒", "25443342124324532", "评价类型：差评\n请关注处理",Class.Template_Manage.get_Temp_ID("59igou", "OPENTM205102209").ToString());
        }

        [WebMethod(Description ="获取整个待评价列表")]
        public DataSet GET_WAIT_RATE(string Seller_Nick)
        {
            return Class.JST_Trade.Get_Trade(Seller_Nick);
        }

        [WebMethod(Description = "获取整个待评价列表")]
        public DataSet GET_WAIT_RATE_Goods_ID(string Seller_Nick,string Goods_ID)
        {
            return Class.JST_Trade.Get_Trade(Seller_Nick,Goods_ID);
        }

        [WebMethod(Description ="获取钉钉消开放平台信息详情")]
        public DataSet GET_DINGTALK_OPEN_INFO(string Seller_Nick)
        {
            return Class.DingTalk.get_DingTalk_Open_Info(Seller_Nick);
        }
        
        [WebMethod(Description ="回评订单")]
        public void ADD_RATE(string Seller_Nick,string Tid,string Content)
        {
            Class.Top_Logic CTL = new Class.Top_Logic(Seller_Nick);
            CTL.ADD_RATE(Tid, Content);
        }

        [WebMethod(Description = "根据物流单号获取订单号")]
        public string GET_WL_ID_USE_TID(string Seller_Nick, string WL_ID,string status)
        {
            return Class.JST_Trade.use_WL_get_Tid(Seller_Nick, WL_ID,status);
        }
    }
}
